package message

type EventMessage struct {
	Typ       string                 `json:"type"`
	DeviceId  string                 `json:"deviceId"`
	ProductId string                 `json:"productId"`
	EventId   string                 `json:"eventId"`
	Data      map[string]interface{} `json:"data"`
}

func NewEventMessage(deviceId string, productId string, eventId string, data map[string]interface{}) EventMessage {
	return EventMessage{
		Typ:       string(EVENT),
		DeviceId:  deviceId,
		ProductId: productId,
		EventId:   eventId,
		Data:      data,
	}
}

func (m *EventMessage) Type() MessageType {
	return EVENT
}

func (m *EventMessage) GetDeviceId() string {
	return m.DeviceId
}
func (m *EventMessage) GetProductId() string {
	return m.ProductId
}
